package org.example.provider.controller;

import org.example.provider.domain.Goods;
import org.example.provider.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Date: 2024/9/27
 * @Author: Administrator
 * @ClassName: GoodsController
 * @Description: comment here
 */

@RestController
@RequestMapping("/goods")
public class GoodsController {

    @Autowired
    private GoodsService goodsService;

    // 返回一个Goods
    @GetMapping("/{id}")
    public Goods getGoods(@PathVariable("id") Integer id) {
        return goodsService.getGoodsById(id);
    }
}
